import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const count = ref(0)
  const handleClose=ref(true)
  const doubleCount = computed(() => count.value * 2)
  const users=ref([])
  function increment() {
    count.value++
  }
  const DatahandleClose=()=>{
    handleClose.value = !handleClose.value
  }
  const AmdinUser=(value)=>{
       users.value=value
  }
  return {
     count,
     doubleCount,
     increment,
     handleClose,
     DatahandleClose,
     users,
     AmdinUser,
       }
},
  {
    persist:true
  }
)
